$(function(){
	var shophosts=$("input[name='shophosts']").val();
	
	myErrorAlert=function(obj){
		$.confirm({
		    title: '<font color="red"><i class="fa fa-fw fa-warning "></i>提示</font>',
		    content: obj,
		    type: 'red',
		    typeAnimated: true,
		    buttons: {
		    	tryAgain: {
		            text: '关闭',
		            btnClass: 'btn-red'
		        }
		    }
		});
	}
	
	mySuccessAlert=function(obj){
		$.confirm({
		    title: '<font color="green"><i class="fa fa-check "></i>提示</font>',
		    content: obj,
		    type: 'green',
		    typeAnimated: true,
		    buttons: {
		    	tryAgain: {
		            text: '关闭',
		            btnClass: 'btn-green'
		        }
		    }
		});
	}
	
	myLoginoutAlert=function(url){
		$.confirm({
			title: '注销?',
		    content: '你将在3秒内自动退出.',
		    type:'red',
		    autoClose: 'logoutUser|3000',
		    buttons: {
		        logoutUser: {
		            text: '直接退出',
		            action: function () {
		            	window.location.href=shophosts+"/logOut";
		                
		            }
		        },
		        取消: function () {
		            $.alert('已取消');
		        }
		    }
		});
	}
	deleteAlert=function(url){
		$.confirm({
		    title: '是否同意删除该信息?',
		    content: '删除后将无法恢复！！',
		    type: 'red',
		    typeAnimated: true,
		    buttons: {
		        tryAgain: {
		            text: 'AGREE',
		            btnClass: 'btn-red',
		            action: function(){
		            location.href=shophosts+url;
		            }
		        },
		        close: function () {
		        }
		    }
		});
	}

})
